import 'package:flutter/material.dart';
import 'package:hbtrans_flutter/utils/mydio.dart';

import '../../apis.dart';
import '../../const.dart';

class AboutUs extends StatefulWidget {
  @override
  _AboutUsState createState() => _AboutUsState();
}

class _AboutUsState extends State<AboutUs> {
  var loadingDialog;
  var about_usStr = '';

  _getNews() {
    MyDio.getInstance(url: Const.TRANS_SERVER_MY_PATH).get(Apis.getAboutUs,
        (data) {
      if (loadingDialog != null) {
        loadingDialog = null;
        Navigator.pop(context);
      }
      print(data['about_us']);
      setState(() {
        about_usStr = data['about_us'];
      });
    });
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _getNews();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Color(0xff23AFDC),
        elevation: 0,
        title: Text('关于我们'),
        centerTitle: true,
      ),
      body: ListView(
        children: <Widget>[
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: Text(about_usStr),
          ),
        ],
      ),
    );
  }
}
